package io.renren.modules.sp.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.common.constant.Constant;
import io.renren.modules.sp.dao.SpTeamAttachDao;
import io.renren.modules.sp.dto.SpTeamAttachDTO;
import io.renren.modules.sp.entity.SpTeamAttachEntity;
import io.renren.modules.sp.service.SpTeamAttachService;
import io.renren.modules.security.user.SecurityUser;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 代表队附件表（承诺书）
 *
 * @author whc
 * @since 3.0 2025-02-16
 */
@Service
public class SpTeamAttachServiceImpl extends CrudServiceImpl<SpTeamAttachDao, SpTeamAttachEntity, SpTeamAttachDTO> implements SpTeamAttachService {

    @Autowired
    private SpTeamAttachDao spTeamAttachDao;

    @Override
    public QueryWrapper<SpTeamAttachEntity> getWrapper(Map<String, Object> params){
        QueryWrapper<SpTeamAttachEntity> wrapper = new QueryWrapper<>();
        return wrapper;
    }

    @Override
    public List<SpTeamAttachEntity> queryByMap(Map<String, Object> params){
        String teamId = (String) params.get("teamId");
        String matchId = (String) params.get("matchId");
        List<SpTeamAttachEntity> list = spTeamAttachDao.selectList(
                new QueryWrapper<SpTeamAttachEntity>()
                        .eq("team_id", teamId)
                        .eq("match_id", matchId)
        );
        return list;
    }

    //hasUpPromissFile
    @Override
    public List<Map<String,Object>> hasUpPromissFile(Long teamId){
        List<Map<String,Object>> list = spTeamAttachDao.hasUpPromissFile(teamId);
        return list;
    }


    @Override
    public List<Map<String,Object>> hasUpSignFile(Long teamId){
        List<Map<String,Object>> list = spTeamAttachDao.hasUpSignFile(teamId);
        return list;
    }

}
